<?php
    mssql_connect("192.168.10.3\DINAMICA", "sa", "admin4");
    mssql_select_db("DGempres10");

    $diag = "SELECT DIACODIGO,DIANOMBRE FROM DGempres10..GENDIAGNO WHERE DIACODIGO LIKE 'O%' ";
    $lstd = mssql_query($diag);
    $result=array();
    while($lst = mssql_fetch_array($lstd)){
        $result[] = $lst['DIANOMBRE']." - ".$lst['DIACODIGO'];
    
    }
    mssql_close();
    print_r(json_encode($result));
?>
